﻿<?php
session_start();

if(isset($_SESSION['loggedIn'])) {
	$loggedIn = true;
}
else {
	$loggedIn = false;
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Lightcontrol</title>

    <!-- Bootstrap libraries -->
    <link href="../bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <script src="../bootstrap/js/bootstrap.min.js"></script>
    
	<!-- Custom styles for this template -->
   
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
  </head>

  <body >

      <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">
          <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" href="index.php">Lightcontrol</a>
        </div>
        <div class="collapse navbar-collapse">
          <ul class="nav navbar-nav">
            <li><a id="index" href="index.php">Home</a></li>
             <li class="dropdown">
				<a href="#" class="dropdown-toggle" data-toggle="dropdown">Electronics<b class="caret"></b></a>
				<ul class="dropdown-menu">
					<li><a id="buildings" href="buildings.php">Geb&auml;ude</a></li>
					<li><a id="rooms" href="rooms.php">R&auml;ume</a></li>
					<li><a id="plugs" href="plugs.php">Steckdosen</a></li>
				</ul>
			</li>
            <li class="active"><a id="contact" href="contact.php">Kontakt</a></li>
          </ul>
		    <ul class="nav navbar-nav navbar-right">
				<?php if($loggedIn){ ?>
					<li><p class="navbar-text"><?php echo "Logged in as ".$_SESSION['username']; ?> </p></li>
					<li><a id="logout" href="logout.php">Logout</a></li>
				<?php }else{ ?>
					<li><a id="login" href="login.php">Login</a></li>
				<?php } ?>
				
		   </ul>
        </div><!--/.nav-collapse -->
      </div>
	</div>
    <div class="container" style="padding-top:100px;">
		<div class="row">
		  <div class="col-md-6 col-md-offset-3">
			<div class="well well-sm">
			  <form class="form-horizontal" action="" method="post">
			  <fieldset>
				<legend class="text-center">Kontaktieren Sie uns</legend>
		
				<!-- Name input-->
				<div class="form-group">
				  <label class="col-md-3 control-label" for="name">Name</label>
				  <div class="col-md-9">
					<input id="name" name="name" type="text" placeholder="Name" class="form-control">
				  </div>
				</div>
		
				<!-- Email input-->
				<div class="form-group">
				  <label class="col-md-3 control-label" for="email">E-Mail</label>
				  <div class="col-md-9">
					<input id="email" name="email" type="text" placeholder="E-Mail" class="form-control">
				  </div>
				</div>
		
				<!-- Message body -->
				<div class="form-group">
				  <label class="col-md-3 control-label" for="message">Nachricht</label>
				  <div class="col-md-9">
					<textarea class="form-control" id="message" name="message" placeholder="Ihre Nachricht..." rows="5"></textarea>
				  </div>
				</div>
		
				<!-- Form actions -->
				<div class="form-group">
				  <div class="col-md-12 text-right">
					<button type="submit" class="btn btn-primary btn-lg">Submit</button>
				  </div>
				</div>
			  </fieldset>
			  </form>
			</div>
		  </div>
		</div>
	</div>
  </body>
  <script>
	$( document ).ready(function() {
		generateDiagramm();
	});
	
	function generateDiagramm(){
		var graph = new joint.dia.Graph;

		var paper = new joint.dia.Paper({
			el: $('#diagramm'),
			width: 800,
			height: 600,
			gridSize: 1,
			model: graph
		});
	}
  </script>
</html>
